// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/accesscontrol/api/TrajectoryApi'

import ListClass from '@api/accesscontrol/model/TrajectoryFindReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 列表 —————————————————————————————— //

  validParam(param) {
    return param.phone
  },
  async getList(param, TIP = '查询人员轨迹') {
    const DTO = CORE.grpcDTO(ListClass, param)
    const resp = await CORE.grpc(TIP, CLIENT, 'trajectoryFind', DTO)
    const list = resp.content || []
    return [list.length, list]
  },
  transList(arr) {
    arr.forEach((item) => {
      item.idNo = CORE.maskIdNo(item.credentialNumber)
    })
    return arr
  },
}
